import { TGameObject, TGameObjectOptions } from './tGameObject';
import { drawRectangle } from '../renderer';

interface RectangleOptions extends TGameObjectOptions {
  fillColor: string;
  strokeColor: string;
}

export class Rectangle extends TGameObject {
  public fillColor: string;

  public strokeColor: string;

  constructor (options: RectangleOptions) {
    super(options);

    const { fillColor, strokeColor, } = options;
    this.fillColor = fillColor;
    this.strokeColor = strokeColor;
  }

  render (canvasCtx: CanvasRenderingContext2D) {
    drawRectangle(canvasCtx, this);
  }
}
